
Chapter 10. Ghostly, Shapely Windows
Hack 10.4: ShapedJFrame

From:
   Windows Programming Using Java
   Gayathri Singh and Andrew Davison

Contacts: 
  Gayathri Singh
  support@jinvoke.com 

and

  Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat Yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th

  Web Site for the book:
     http://fivedots.coe.psu.ac.th/~ad/winJava/


If you use this code, please mention our names, and include links
to the book's Web site.

Thanks,
  Gayathri and Andrew


============================
Hack 10.4: ShapedJFrame/

The files and directories are: 

* ShapedJFrame.java, PaintedPanel.java

* compile.bat, run.bat   
     // batch files for compiling and running (most of) the examples;
     // they utilize J/Invoke (see below)

* images/
    - arrow.png, miniSteel.jpg, rivets.jpg


------
Compilation and Execution
=========================

> compile *.java

> run ShapedJFrame  [ < translucency value 1-255 > ]
e.g.
> run ShapedJFrame 128

* To move the window: drag the cursor with the left mouse button pressed.
* To iconify/close: right click to show a popup menu.


------
Modyifying the Panel's Background

* To DISPLAY AN IMAGE, uncomment the code fragment with the
  comment "// display an image" in paintComponent() in 
  PaintedJPanel.java. Also comment out the code fragment
  with the comment "// draw a gradient".

  Uncomment the required BACK_IM static constant at 
  the start of PaintedJPanel.java

* If you add new images, make sure to put them in the images/ 
  subdirectory.


* To DISPLAY A GRADIENT, uncomment the code fragment with the
  comment "// display a gradient" in paintComponent() in 
  PaintedJPanel.java. Also comment out the code fragment
  with the comment "// draw an image".


-------
J/Invoke

A 30-day evaluation version of J/Invoke can be downloaded from
http://www.jinvoke.com/download. Unzip it and store in a directory.

The batch files in this directory (compile.bat and run.bat) assume 
that jinvoke.jar is located in d:\jinvoke\

---------
Last updated: 13th June 2008
